package cn.yhp.mybatis.reflection.invoker;

import java.lang.reflect.Field;

/**
 * getter调用者
 * @author yhp
 * @date 2023/12/3
 */
public class GetFieldInvoker implements Invoker{

    private Field field;

    public GetFieldInvoker(Field field){
        this.field=field;
    }


    @Override
    public Object invoke(Object target, Object[] args) throws Exception {
        return field.get(target);
    }

    @Override
    public Class<?> type() {
        return field.getType();
    }
}
